Skip to content

fix(deps): bump form-data, proxy-addr, next-auth, MCP SDK and AI SDK in rag-knowledge-agent - #50

Merged
glebedel merged 1 commit into
mainfrom
security-autopilot/ak-25919954-examples-form-data
Nov 23, 2026
Merged

glebedel merged 1 commit into
mainfrom
security-autopilot/ak-25919954-examples-form-data

Conversation

@s2d2-agent

@s2d2-agent s2d2-agent Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Guillaume Lebedel (guillaume@stackone.com).

Why

Aikido flags five vulnerable dependencies in apps/rag-knowledge-agent: form-data (critical, predictable multipart boundary and CRLF in field names), proxy-addr (critical, IPv4-mapped IPv6 trust bypass), next-auth (critical, three advisories fixed in 4.24.15), @hono/node-server (high, authorization bypass, reached through @modelcontextprotocol/sdk) and @ai-sdk/provider-utils (high, SSRF, reached through ai and @ai-sdk/openai). Each move is to the lowest version that clears the advisory, inside the current major of every direct dependency.

What changed

Two files: apps/rag-knowledge-agent/package.json raises three ranges, and package-lock.json resolves the fixed versions.

Package Before After How
form-data 4.0.5 4.0.6 lockfile
proxy-addr 2.0.7 2.0.8 lockfile
next-auth 4.24.13 4.24.15 ^4.24.15
@modelcontextprotocol/sdk 1.26.0 1.32.2 lockfile (via @stackone/ai)
@hono/node-server 1.19.13 2.1.11 via the SDK, which accepts 2.x from 1.30.0; no fixed 1.x exists
ai 6.0.70 6.0.287 ^6.0.287
@ai-sdk/openai 3.0.25 3.0.115 ^3.0.115
@ai-sdk/provider-utils 4.0.13 4.0.52 via the two above

Transitive moves that come with them: @ai-sdk/gateway 3.0.197, @ai-sdk/provider 3.0.16, @vercel/oidc 3.2.0, eventsource-parser 3.1.1, hasown 2.0.4, uuid 11.1.1, undici 6.29.1 (new, see below). next-auth's nested uuid 8.3.2 is gone because next-auth now accepts the hoisted 11.1.1. No package was removed from the app's direct dependencies. This supersedes Dependabot #45 (the same SDK bump).

Proof

Run on a clean install of this lockfile:

Check main This branch
npm audit total / critical / high 44 / 3 / 24 35 / 1 / 22
Copies of each fixed package in the lockfile vulnerable one copy each, at the fixed version
next build --webpack ok ok, same route table
eslint 0 errors, 4 warnings 0 errors, same 4 warnings
tsc --noEmit 13 errors same 13 (antd and react typings, none in auth or chat files)
next start: GET /login, /api/health, /api/auth/providers 200 200

The Aikido PR check on this head removes 30 open issues, including the @modelcontextprotocol/sdk, ai and next-auth's uuid 8.3.2 groups on top of the five above.

It adds three on undici 6.29.1 (one medium, recursion; two low, prototype pollution). @ai-sdk/provider-utils has required undici ^6.28.0 since 4.0.48, every current AI SDK release brings it, and 6.29.1 is the newest 6.x: Aikido lists fixes only in 7.x and 8.x. provider-utils loads it in one place, createSafeNodeFetch behind getDefaultDownloadFetch, the DNS-checked fetch for downloading URL file parts (dist/index.mjs lines 444 to 470). This app sends text messages only, so that path is not reached. Forcing undici 7 with an overrides entry would break the range provider-utils declares, so this PR leaves it and flags it for a decision.

The remaining critical is next itself, which Dependabot #49 (next 16.4.6) fixes, along with sharp. hono 4.11.7 is covered by Dependabot #48. pdfjs-dist 4.8.69 stays: react-pdf 9 pins it through @llamaindex/chat-ui, so clearing it needs a react-pdf 10 upgrade, which is a separate decision. The app has no test suite, so build, lint, typecheck and the boot checks above are the regression check.

Reviews on this head: Forge (no rewrite needed), security scan (0 findings, no advisory left on any changed package), Codex security pass (0 vulnerabilities), /security-review (0), /code-review (5 candidates, each answered below), eng-review (0), plus an independent review of the auth and chat code paths against the new versions.

/code-review candidates and answers: Node 20 is already required by @stackone/ai 2.3.0 (engines >=20.19.6), so the @hono/node-server 2.x floor adds nothing new. hono is on #48. The uuid 11 move on the auth path is covered by the build and the /api/auth/providers 200, and getToken was exercised directly on 4.24.15. undici is only used by the SDK's URL download path, which this app never calls. The ai and @stackone/ai peer coupling predates this change.

Risk and rollback

  • Google sign-ins that are mid-flight during the deploy fail once: next-auth 4.24.15 binds the OAuth check cookies to the provider that set them. Users retry and succeed. Credentials sign-in is unaffected.
  • next-auth 4.24.15 now prefers NEXTAUTH_URL over the forwarded host when it works out the origin. If a deployment still has a placeholder NEXTAUTH_URL (as DEPLOYMENT.md suggests for a first deploy), OAuth redirects follow the placeholder until it is set.
  • getToken now returns null on a malformed Bearer header instead of throwing; the middleware already redirects to login on null.
  • The MCP client no longer follows redirects to another domain by default. That only matters if the StackOne MCP endpoint redirects across domains.
  • Rollback: revert this commit. Nothing else depends on it.

What we will watch after deploy

  • The Vercel deployment builds and /api/health returns 200.
  • A Google sign-in and a credentials sign-in both complete, and an authenticated /api/chat request streams a reply with at least one tool call.
  • Vercel function logs for the chat and auth routes show no new error signatures compared with the day before the deploy.
  • The Aikido rescan closes the form-data, proxy-addr, next-auth, @hono/node-server and @ai-sdk/provider-utils issues for this app.

Opened by Security Autopilot (s2d2) for Guillaume Lebedel from Aikido issue 25919954, under the automatic Aikido fix approval of 2026-11-01.

🤖 Generated with Claude Code

Review gates and proof

Recorded by s2d2 on 019b55e. Kind of change: code.

gate result
forge ran
security_scan ran
codex_security ran
security_review ran
code_review ran
eng_review ran
demo not run
local_stack ran

…in rag-knowledge-agent

Clears Aikido groups 25919954 (form-data 4.0.6), 45888009 (proxy-addr
2.0.8), 37073872 (next-auth 4.24.15), 23398993 (@hono/node-server
2.1.11 via @modelcontextprotocol/sdk 1.32.2) and 30593950
(@ai-sdk/provider-utils 4.0.52 via ai 6.0.287 and @ai-sdk/openai
3.0.115). All stay inside their current majors. SEC-315.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <guillaume@stackone.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
@glebedel
glebedel merged commit d242626 into main Nov 23, 2026
4 checks passed

This branch was previously deployed

1 inactive deployment
Preview – oauth-redirect-proxy — 019b55e3 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants